#include <iostream>
#include <string>
using namespace std;

int main()
{
	string str;
	cin >> str;
	int c = str[0];
	int num = 1;
	for (int i = 1;i < str.length();i++) {
		if (str[i] == c)
			num++;
		else {
			printf("%d%c", num, c);
			c = str[i];
			num = 1;
		}
	}
	printf("%d%c", num, c);
	return 0;
}